<template>
  <div class="container">
    <!-- <div class="worktab flex">
      <div class="tabinfo flex-item" @click="goServive">
        <span class="pic fwjl"></span>
        <span class="words">服务记录</span>
         <span class="num_icons">{{fuwunum}}</span>
      </div>
      <div class="tabinfo flex-item" @click="goReturnvisit">
        <span class="pic dhhf"></span>
        <span class="words">顾客回访</span>
         <span class="num_icons">{{huifangnum}}</span>
      </div>
      <div class="tabinfo flex-item">
        <span class="pic jtrc">
          <i>{{today}}</i>
        </span>
        <span class="words">今天日程</span>
         <span class="num_icons">{{daynum}}</span>
      </div>
      <div class="tabinfo flex-item">
        <span class="pic txbb"></span>
        <span class="words">填写报表</span>
      </div>
    </div>-->
    <div class="menu">
      <div class="header">
        <span class="shu"></span>预约和订单
      </div>
      <div
        class="menu_list flex press"
        data-url="/pages/guest/orderlist/orderlist"
        @click="navigateTo"
      >
        <span class="words flex-item">订单管理</span>
        <span class="grey_arrow"></span>
      </div>
    </div>

    <div class="menu">
      <div class="header">
        <span class="shu"></span>客户数据
      </div>
      <div
        class="menu_list flex press"
        data-url="/pages/guest/customerlist/customerlist"
        @click="navigateTo"
      >
        <span class="words flex-item">客户管理</span>
        <span class="grey_arrow"></span>
      </div>
      <div class="menu_list flex press" data-url="/pages/guest/yejiplan/yejiplan" @click="planning">
        <span class="words flex-item">业绩规划</span>
        <span class="grey_arrow"></span>
      </div>
      <!-- <div class="menu_list flex" data-url="/pages/guest/expandingCustomers/expandingCustomers" @click="navigateTo">
        <span class="words flex-item">拓客管理</span>
        <span class="grey_arrow"></span>
      </div>-->
    </div>
  </div>
</template>

<script>
import wx from 'wx'
import api from '@/utils/api'
export default {
  data () {
    return {
      today: 0,
      fuwunum: 0,
      huifangnum: 0,
      daynum: 0,
      sheettype: 0
    }
  },

  components: {
  },
  async onLoad () {
    await Promise.all([
      this.getsystemworkinfo()
    ])
  },
  methods: {
    async getsystemworkinfo () {
      let ismanage = wx.getStorageSync('userInfo').ismanage;
      let userId = wx.getStorageSync('userInfo').user_id;
      let jsonshop = wx.getStorageSync('userInfo').jsonshop;
      let floor = wx.getStorageSync('userInfo').floor;
      const res = await api.getsystemworkinfo({ jsonshop: jsonshop, floor: floor, ismanage: ismanage, user_id: userId });
      console.log(res)
      if (res) {
        if (res.code === '100') {
          this.daynum = res.daynum
          this.fuwunum = res.fuwunum
          this.huifangnum = res.huifangnum
          this.sheettype = res.sheettype
        }
      }
    },
    navigateTo (e) {
      let urlinfo = e.mp.currentTarget.dataset.url
      wx.navigateTo({
        url: urlinfo
      })
    },
    planning () {
      let floor = wx.getStorageSync('userInfo').floor;
      if (floor === 0) {
        wx.navigateTo({
          url: '/pages/guest/viewplanning/viewplanning'
        })
      } else {
        wx.navigateTo({
          url: '/pages/guest/yejiplan/yejiplan'
        })
      }
    },
    goServive () {
      wx.navigateTo({
        url: '/pages/guest/serviceRecord/serviceRecord'
      })
    },
    goReturnvisit () {
      wx.navigateTo({
        url: '/pages/guest/returnvisitRecord/returnvisitRecord'
      })
    }
  },
  created () {
    let myDate = new Date()
    this.today = myDate.getDate()
  }
}
</script>

<style scoped>
.worktab {
  width: 100%;
  padding: 28rpx 30rpx;
  background: #fff;
  margin-bottom: 16rpx;
}
.worktab .tabinfo {
  position: relative;
}
.worktab .tabinfo span {
  display: block;
}
.worktab .tabinfo .pic {
  margin: 0 auto;
  margin-bottom: 30rpx;
}
.worktab .tabinfo .words {
  font-size: 28rpx;
  font-weight: 400;
  color: rgba(102, 102, 102, 1);
  text-align: center;
}
.worktab .tabinfo .num_icons {
  position: absolute;
  top: -10rpx;
  right: 24rpx;
  width: 32rpx;
  height: 25rpx;
  text-align: center;
  color: #fff;
  border-radius: 50%;
  background: #ff4444;
  font-size: 24rpx;
  line-height: 25rpx;
}
.worktab .tabinfo .pic.fwjl {
  width: 76rpx;
  height: 74rpx;
  background: url(http://mytimg.178mr.com/fwjl@3x.png) no-repeat;
  background-size: 100%;
}
.worktab .tabinfo .pic.dhhf {
  width: 68rpx;
  height: 72rpx;
  background: url(http://mytimg.178mr.com/gkhf@3x.png) no-repeat;
  background-size: 100%;
}
.worktab .tabinfo .pic.jtrc {
  width: 64rpx;
  height: 74rpx;
  background: url(http://mytimg.178mr.com/rc@3x.png) no-repeat;
  background-size: 100%;
  position: relative;
}
.worktab .tabinfo .pic.jtrc i {
  position: absolute;
  left: 50%;
  bottom: 10rpx;
  width: 100%;
  font-size: 32rpx;
  color: rgba(255, 68, 68, 1);
  text-align: center;
  transform: translateX(-50%);
}
.worktab .tabinfo .pic.txbb {
  width: 74rpx;
  height: 72rpx;
  background: url(http://mytimg.178mr.com/bb@3x.png) no-repeat;
  background-size: 100%;
}
.menu {
  width: 100%;
  margin-bottom: 18rpx;
  background: #fff;
  padding: 28rpx 0;
  padding-bottom: 0;
}
.menu .header {
  font-size: 32rpx;
  font-weight: bold;
  color: rgba(51, 51, 51, 1);
  margin-bottom: 18rpx;
  padding-left: 32rpx;
}
.menu .header .shu {
  display: inline-block;
  width: 4rpx;
  height: 20rpx;
  background: rgba(255, 68, 68, 1);
  opacity: 1;
  border-radius: 2rpx;
  margin-right: 12rpx;
}
.menu .menu_list {
  padding: 0 32rpx 0 44rpx;
  font-size: 28rpx;
  font-weight: 400;
  color: rgba(102, 102, 102, 1);
  position: relative;
  line-height: 80rpx;
}
.menu .menu_list::after {
  content: "";
  position: absolute;
  left: 4rpx;
  bottom: 0;
  width: 100%;
  height: 2rpx;
  background: RGBA(153, 153, 153, 0.2);
}
.menu .menu_list:last-child::after {
  background: RGBA(153, 153, 153, 0);
}
.menu .menu_list .grey_arrow {
  display: inline-block;
  width: 12rpx;
  height: 28rpx;
  background: url(http://mytimg.178mr.com/grey_arrow.png) no-repeat;
  background-size: 100%;
  position: relative;
  top: 6rpx;
}
</style>
